<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let name=prompt('请输入姓名:')
        let age=prompt('请输入年龄：')
        let sex=prompt('请输入性别：')
        let num=prompt('你现在多少岁了？')
        document.write(name+"<br>",age+"<br>",sex+"<br>")
        console.log('用户姓名:'+name)
        console.log('用户年龄:'+age)
        console.log('用户性别:'+sex)
        console.log(`据我估计,五年后,你可能${+num+5}岁了`)
        let pname =prompt('输入商品名称:')
        let price = prompt('输入商品价格:')
        let x = prompt('输入商品数量:')
        let address = prompt('输入收货地址:')
        let total = x*price
        document.write(
        `<table border="1" width="600" height="150" cellspacing="0" cellpadding="0" align="center">
            <caption><h1>订单确认</h1></caption>
            <tr>
              <th>商品名称</th>
              <th>商品价格</th>  
              <th>商品数量</th>  
              <th>总价</th>
              <th>收货地址</th>    
            </tr>
            <tr>
              <th>${pname}</th>
              <th>${price}</th>
              <th>${x}</th>
              <th>${total}</th>
              <th>${address}</th>
            </tr>
        </table>`
        )
    </script>
</body>
</html>